package shuashuami.hb.com.hdlibrary.glid;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

/**
 * Created by hufangda on 2017/5/7.
 */

public class GlidUtil {

    private Context context;

    public GlidUtil(Context context) {
        super();
        this.context = context;
    }

    //加载图片
    public void uploadImage(String imageUrl,int yujiazai, ImageView imageView) {
        Glide.with(context).load(imageUrl).placeholder(yujiazai).into(imageView);
    }

    //圆角图片加载
    public void uploadRound(String url, int size, ImageView imageView) {
        if (size == 0) {
            Glide.with(context).load(url).transform(new GlideRoundTransform(context)).into(imageView);
        } else {
            Glide.with(context).load(url).transform(new GlideRoundTransform(context, 10)).into(imageView);
        }
    }

    //加载圆形图片
    public void uploadCircle(String url, ImageView imageView,int jiazai) {
        Glide.with(context).load(url).placeholder(jiazai).transform(new GlideCircleTransform(context)).into(imageView);
    }



}
